﻿/* Copyright 2007 dnAnalytics Project.
 *
 * Contributors to this file:
 * Patrick van der Velde
 * Marcus Cuda - http://marcus.cuda.net
 *
 * This file is part of dnAnalytics.  dnAnalytics is licensed under the 
 * Microsoft Public License. See License.txt for a complete copy of the
 * license.
 */

using System;
using System.Runtime.Serialization;
using dnAnalytics.LinearAlgebra;

namespace dnAnalytics{
    ///<summary>The exception is thrown when a <see cref="Matrix"/> or <see cref="Vector"/> with the wrong dimensions is used.</summary>
	[Serializable]
	public sealed class NotConformableException : dnAnalyticsArgumentException {

		///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class.</summary>
		public NotConformableException() { }

		///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class with a specified error message.</summary>
		///<param name="message">The error message that explains the reason for the exception.</param>
		public NotConformableException( string message ) : base( message ) { }

		///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class with a specified error message 
		///and a reference to the inner exception that is the cause of this exception.</summary>
		///<param name="message">The error message that explains the reason for the exception.</param>
		///<param name="inner">The exception that is the cause of the current exception. 
		///If the innerException parameter is not a null reference, the current exception is raised in a <strong>catch</strong> block 
		///that handles the inner exception.</param>
		public NotConformableException( string message, Exception inner ) : base( message, inner ) { }

		///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class with serialized data.</summary>
		///<param name="info">The error message that explains the reason for the exception.</param>
		///<param name="context">The error message that explains the reason for the exception.</param>
		private NotConformableException( SerializationInfo info, StreamingContext context ) : base( info, context ) { }

        ///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class with a specified error message.</summary>
        ///<param name="message">The error message that explains the reason for the exception.</param>
        ///<param name="parameter">The parameter that caused the exception.</param>
        public NotConformableException(string parameter, string message) : base(message, parameter) { }

        ///<summary>Initializes a new instance of the <strong>NotConformableException</strong> class with a specified error message 
        ///and a reference to the inner exception that is the cause of this exception.</summary>
        ///<param name="message">The error message that explains the reason for the exception.</param>
        ///<param name="parameter">The parameter that caused the exception.</param>
        ///<param name="inner">The exception that is the cause of the current exception. 
        ///If the innerException parameter is not a null reference, the current exception is raised in a <strong>catch</strong> block 
        ///that handles the inner exception.</param>
        public NotConformableException(string parameter, string message, Exception inner) : base(message, parameter, inner) { }
	}
}